package com.lankystar.logistucs.spring.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="twoOrder")
public class TwoOrder {

	private int twoOrderId;
	private String twoOrderNu;
	private long createTime;
	private int type;//便于查询、没有意义
	private OneOrder oneOrder;
	private OrderType orderType;
	private Truck truck;
	private User user;
	private List<TwoOrderAndTwoStatus> tats;
	private Record record;
	private int remove;//0未删除、1删除
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getTwoOrderId() {
		return twoOrderId;
	}
	public void setTwoOrderId(int twoOrderId) {
		this.twoOrderId = twoOrderId;
	}
	public String getTwoOrderNu() {
		return twoOrderNu;
	}
	public void setTwoOrderNu(String twoOrderNu) {
		this.twoOrderNu = twoOrderNu;
	}
	public long getCreateTime() {
		return createTime;
	}
	public void setCreateTime(long createTime) {
		this.createTime = createTime;
	}
	@ManyToOne
	@JoinColumn(name="oneOrder_Id")
	public OneOrder getOneOrder() {
		return oneOrder;
	}
	public void setOneOrder(OneOrder oneOrder) {
		this.oneOrder = oneOrder;
	}
	@OneToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="orderType_Id")
	public OrderType getOrderType() {
		return orderType;
	}
	public void setOrderType(OrderType orderType) {
		this.orderType = orderType;
	}
	@OneToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="truck_Id")
	public Truck getTruck() {
		return truck;
	}
	public void setTruck(Truck truck) {
		this.truck = truck;
	}
	@ManyToOne
	@JoinColumn(name="user_Id")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	@ManyToOne
	@JoinColumn(name="record_Id")
	public Record getRecord() {
		return record;
	}
	public void setRecord(Record record) {
		this.record = record;
	}
	public int getRemove() {
		return remove;
	}
	public void setRemove(int remove) {
		this.remove = remove;
	}
	@OneToMany(mappedBy="twoOrder")
	public List<TwoOrderAndTwoStatus> getTats() {
		return tats;
	}
	public void setTats(List<TwoOrderAndTwoStatus> tats) {
		this.tats = tats;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	
	
	
}
